<include file="Common:header" />
<TYjs file='fix_table_title'/>
<TYjs file='init'/>
<div class="table_content">
    <form action="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME)}" method="post" class="ajax_form">
        <div class="toolbar">
            <select id="select_orders_status" name="search">
                <option value="99">全部</option>
                <option value="1">退款中</option>
                <option value="2">退款成功</option>
            </select>

            <select id="select_orders" name="order_find">
                <option value="1">商戶订單號</option>
                <option value="2">商戶退款單號</option>
                <!-- <option value="3">申請人</option> -->
            </select>
            <input type="text" class="text w150" name="keywords"  title="請填寫关键词" placeholder="請填寫关键词"/>
            <button type="submit">查询</button>

        </div>
    </form>

    <form action="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/delete_orders')}" method="post" class="ajax_form">
        <table class="orders_table">
            <tr>
                <!-- <th width="11%">退款單號</th> -->
                <th width="8%">車牌</th>
                <th width="6%">退款金额</th>
                <th width="6%">申請人</th>
                <th width="8%">客戶(手機號)</th>
                <th width="11%">提交時間</th>
                <th width="6%">退款狀態</th>
            </tr>
            <foreach name='refundList' item='vo' key="k">
                <tr>
                    <td class="bgce1" colspan="8" style="text-align: left;">
                        <span style="float: left;padding-left: 5%;">
                            商戶訂單號：<span style="color:#ff8800">{$vo.ordersn}</span>
                        </span>
                        <span style="float:left;padding-left: 18%;">
                            退款訂單號：<span style="color:#ff8800">{$vo.refund_ordersn}</span>
                        </span>
                        <span style="float: right;padding-right: 5%;">
                            退款完成時間：<span style="color:#ff8800">{$vo.refund_time|date="Y-m-d H:i:s",###}</span>
                        </span>
                        <div class="cl"></div>
                    </td>
                </tr>
                <tr>
                    <td class="txtc">{$vo['license_plate']}</td>
                    <td class="txtc">￥{$vo['refund_price']}</td> <!-- 支付金額 -->
                    <td class="txtc">{$vo['user_name']}</td>
                    <td class="txtc">{$vo['order_phone']}</td>
                    <td class="txtc">{$vo.submit_time|date="Y-m-d H:i:s",###}</td>
                    <td class="txtc"> <!-- 退款狀態 -->
                            <switch name="vo.refund_status">
                                <case value="1">退款中</case>
                                <case value="2">退款成功</case>
                                <default />退款异常
                            </switch>
                    </td>
                </tr>
                <tr style="height:10px;" >
                    <td class="bgcf5"colspan="8"></td>
                </tr>
            </foreach>
        </table>
    </form>
    <!-- 分頁 -->
    <div class="page">{$page}</div>

</div>
<include file="Common:footer" />
<script type="text/javascript">

/**
 * 退款事件
 */
$('.list_table a.tui').click(function(e) {
    var url = $(this).attr('href');
    var $this = $(this);
    var tips = $(this).attr('tips');
    if (tips == null) {
        tips = '您确定要退款吗？';
    }
    art.dialog({
        id: 'confirm',
        title: langjs.message,
        icon: 'question',
        opacity: .1,
        resize: false,
        lock: true,
        fixed: true,
        content: tips,
        button: [
            {
                name: '确定',
                callback: function() {
                    this.close();
                    $this.tyAjax({
                        isForm: false,
                        url: url,
                        callBack: function(data) {
                            icon = data.status > 0 ? 'succeed' : 'error';
                            art.dialog({
                                "icon": icon,
                                "title": langjs.message,
                                "id": "loadding",
                                "lock": true,
                                "fixed": true,
                                "drag": false
                            }).content(data.info).time(1);

                            if (data.status) {
                                $this.parents('tr').children('.refund_status').children('span').attr('class','status_enable');
                                $this.parents('tr').children('.operation').append('<a class="delete" href="'+data.content+'" title="{$Think.lang.delete}"></a>');
                            }
                        }
                    });
                    return false;
                },
                focus: true
            },
            {
                name: langjs.cancle
            }
        ]
    });
    e.preventDefault();
    //终止事件 不再派发事件
    e.stopPropagation();
});
</script>
